package cn.edu.xmu.orderpayment.order.microservice.service;

import cn.edu.xmu.orderpayment.order.microservice.retvo.FreightCalRetVo;
import cn.edu.xmu.orderpayment.order.microservice.vo.FreightCalVo;
import cn.edu.xmu.orderpayment.order.microservice.retvo.RegionRetVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author Yujie Lin
 * @date 2021/12/8 17:17
 */
@FeignClient(name = "freight-service")
public interface FreightService {
    @GetMapping("internal/region/{id}")
    InternalReturnObject<RegionRetVo> getRegionById(@PathVariable Long id);

    @PostMapping("regions/{rid}/price")
    InternalReturnObject<FreightCalRetVo> calFreight(@PathVariable Long rid, @RequestBody List<FreightCalVo> vos);

}
